package com.hksj.Intelligentmanagement.controller;

import com.hksj.Intelligentmanagement.common.Result;
import com.hksj.Intelligentmanagement.dto.LampControlDTO;
import com.hksj.Intelligentmanagement.service.LampControlService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName LampControlController
 * @Description TODO
 * @Author @陈章
 * @Date 2023/4/6 15:09
 * @Version 1.0
 */
@Api(tags = "灯控管理")
@RestController
@RequestMapping("/api/lampControl")
public class LampControlController {

    @Autowired
    private LampControlService lampControlService;

    @ApiOperation(value = "灯控开关")
    @PostMapping("/control")
    public Result control(@RequestBody @Validated LampControlDTO lampControlDTO) {
        return lampControlService.control(lampControlDTO);
    }

    @ApiOperation("分页查询灯控信息")
    @PostMapping("/queryInfosByPaging")
    public Result queryInfosByPaging(@RequestBody LampControlDTO lampControlDTO){
        return lampControlService.queryInfosByPaging(lampControlDTO);
    }

}
